package com.letwal.cmcvnd.aviewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import com.letwal.cmcvnd.base.BaseViewModel
import com.letwal.cmcvnd.anetwork.ApiUserReposity
import com.letwal.cmcvnd.data.ReqBase

class ConfigViewModel : BaseViewModel() {

    //////////////////////////////////////////
    private val mGetRechargeIncomeConfigLiveData = MutableLiveData<ReqBase>()

    val onGetRechargeIncomeConfigLiveData =
        Transformations.switchMap(mGetRechargeIncomeConfigLiveData) { query ->
            ApiUserReposity.getRechargeIncomeConfig(this, query)
        }

    fun getRechargeIncomeConfig(reqBase: ReqBase) {
        mGetRechargeIncomeConfigLiveData.value = reqBase
    }
}